#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int>num(100001,0);
    int sum_n=0,sum_o=0,sum=0,mom=0;
    for(int i=0;i<n;i++)
    {
    	cin >> mom;
    	num[mom]++;
	}
	for(int i=0;i<100001;i++)
	{
		if(num[i]==1)
		{
			sum_o++;//3
		}
		else if(num[i]>2)
		{
			sum_n+=(num[i]-2);//1
		}
	}
	if(sum_n>sum_o)
	{
		sum = sum_n;
	}
    else{
    	sum = (sum_o-sum_n) /2+sum_n;//1+1
	}
	cout << sum <<endl;
    return 0;
}
